package model;

import android.util.Log;

import base.BaseModel;
import base.BaseObserver;
import base.ResultCallBack;
import bean.GuangGaoBean;
import bean.ResultBean;
import jiyun.com.yiyanmeng.http.HttpManager;
import jiyun.com.yiyanmeng.http.MySerivce;
import utils.RxUtil;

/**
 * Created by Windows on 2019/11/5.
 */

public class GuangGaoModel extends BaseModel {
    public void requestGuangGao(final ResultCallBack<GuangGaoBean> resultCallBack) {
        MySerivce serivce = HttpManager.getInstance().getSerivce();
        serivce.guangGao().compose(RxUtil.<ResultBean<GuangGaoBean>>changeThread())
                .compose(RxUtil.<GuangGaoBean>changeResult())
                .subscribe(new BaseObserver<GuangGaoBean>() {
                    @Override
                    public void onSuccess(GuangGaoBean guangGaoBean) {
                        resultCallBack.onSuccess(guangGaoBean);


                    }

                    @Override
                    public void onFail(String error) {
                        resultCallBack.onFail(error);


                    }
                });

    }
}
